﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Formboard
{
	public class Cell
	{
		public EnumCell value;
		private int x;

		public int X {
			get { return x; }
			set { x = value; }
		}

		private int y;

		public int Y {
			get { return y; }
			set { y = value; }
		}

		private List<Cell> neighbors;
		public bool check;

		public List<Cell> Neighbors {
			get { return neighbors; }
			set { neighbors = value; }
		}

		public void addNeighbor (Cell aNeighbor)
		{
			if (this.neighbors.Count.Equals (4)) {
				throw new Exception ("already 4 neighbors");
			} else {
				this.neighbors.Add (aNeighbor);
			}
		}

		public Cell (int x, int y)
		{
			this.x = x;
			this.y = y;
			this.neighbors = new List<Cell> ();
		}

		public EnumCell Value {
			get { return this.value; }
			set { this.value = value; }
		}
	}
}
